<template>
	<view>
		<uni-popup ref="list" type="bottom" :mask-click="false" class="popup">
			<view class="header c-flex jc-between" style="">
				<view @tap='sure(0)'>取消</view>
				<view class="title">选择出库订单</view>
				<view @tap='sure(1)'>确定</view>
			</view>
			<picker-view style="" :indicator-style="indicatorStyle" :value="value" @change="change">
				<picker-view-column>
					<view style="" class="item" v-for="(item,index) in list" :key="index">
						{{item.flowOrderName || ''}}
					</view>
				</picker-view-column>


			</picker-view>
		</uni-popup>
	</view>
</template>

<script>
	export default {
		name: "nk-picker",
		props: {
			list: {
				type: Array,
				default () {
					return []
				}
			},
		},
		data() {
			return {
				indicatorStyle: `height: 50px;line-height:50px;`,
				value: [0],
				choose_index: 0

			};
		},
		methods: {
			open() {
				this.$refs.list.open();
			},
			change(e) {
				
				this.choose_index = e.detail.value[0];
			},
			sure(index) {
				if (index === 1) {


					// let data = this.list[this.choose_index]
					// console.log(this.choose_index);
					this.$emit('chooseVal', this.choose_index);

				} else {

					this.$emit('cancel', '');
				}

				this.$refs.list.close();
			}
		}
	}
</script>

<style lang="scss" >
uni-popup{
	.header{
		background-color: #FFFFFF;
			height: 100rpx;
			padding: 0 30rpx;
			line-height: 100rpx;display: flex;
			justify-content: space-between;
	}
	picker-view{
		width: 100%;height: 500rpx;
			background-color: #FFFFFF;
			.item{
				display: flex;
				justify-content: center;
				align-items: center;
			}
	}
}
</style>